FROM tensorflow/tensorflow:1.15.4-gpu-py3

RUN sed -i s/security.ubuntu.com/mirrors.cloud.tencent.com/g /etc/apt/sources.list
RUN sed -i s/archive.ubuntu.com/mirrors.cloud.tencent.com/g /etc/apt/sources.list
RUN rm -Rf /etc/apt/sources.list.d/*

RUN apt-get update
RUN apt-get install -y  htop iftop git ansible unzip make autoconf wget curl
RUN apt-get install -y gcc g++ cmake python-pip python python3 python3-dev python-dev


WORKDIR /home/coder/.pip/
ADD ./files/pip.conf .

WORKDIR /home/coder/soft
ADD https://mirrors.cloud.tencent.com/nodejs-release/v14.4.0/node-v14.4.0-linux-x64.tar.xz  .
ADD https://dl.google.com/go/go1.13.14.linux-amd64.tar.gz .
ADD https://mirrors.tuna.tsinghua.edu.cn/AdoptOpenJDK/8/jdk/x64/linux/OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz .
ADD https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip .

RUN sudo tar -xvf ./node-v14.4.0-linux-x64.tar.xz
RUN sudo tar -xvf ./go1.13.14.linux-amd64.tar.gz
RUN sudo tar -xvf ./OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz
RUN sudo unzip ./apache-maven-3.6.3-bin.zip 

RUN sudo rm -Rf node-v14.4.0-linux-x64.tar.xz
RUN sudo rm -Rf go1.13.14.linux-amd64.tar.gz
RUN sudo rm -Rf OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz
RUN sudo rm -Rf apache-maven-3.6.3-bin.zip 

RUN sudo chmod -Rf 777 ./*

ENV NODE_HOME /home/coder/soft/node-v14.4.0-linux-x64/bin
ENV GOPATH /home/coder/gopath
ENV GOROOT /home/coder/soft/go
ENV GOCACHE /tmp
ENV JAVA_HOME /home/coder/soft/jdk8u275-b01
ENV MAVEN_HOME /home/coder/soft/apache-maven-3.6.3
ENV PATH $PATH:/home/coder/soft/node-v14.4.0-linux-x64/bin:/home/coder/soft/go/bin:/home/coder/soft/jdk8u275-b01/bin:/home/coder/soft/apache-maven-3.6.3/bin



RUN code-server --install-extension eamodio.gitlens
RUN code-server --install-extension octref.vetur 
# RUN code-server --install-extension wscats.vue
RUN code-server --install-extension xabikos.JavaScriptSnippets
RUN code-server --install-extension CoenraadS.bracket-pair-colorizer
# RUN code-server --install-extension wscats.search
RUN code-server --install-extension dbaeumer.vscode-eslint
RUN code-server --install-extension streetsidesoftware.code-spell-checker
RUN code-server --install-extension christian-kohler.npm-intellisense
# RUN code-server --install-extension visualstudioexptteam.vscodeintellicode
RUN code-server --install-extension dsznajder.es7-react-js-snippets
RUN code-server --install-extension esbenp.prettier-vscode

RUN code-server --install-extension ms-python.python
RUN code-server --install-extension magicstack.MagicPython
RUN code-server --install-extension wholroyd.jinja
RUN code-server --install-extension batisteo.vscode-django
RUN code-server --install-extension ms-vscode.cpptools
RUN code-server --install-extension redhat.java
RUN code-server --install-extension vscjava.vscode-java-debug
RUN code-server --install-extension vscjava.vscode-java-test	
RUN code-server --install-extension vscjava.vscode-maven	
RUN code-server --install-extension vscjava.vscode-java-dependency
RUN code-server --install-extension vscjava.vscode-java-debug	

RUN code-server --install-extension MS-CEINTL.vscode-language-pack-zh-hans
RUN code-server --install-extension ms-azuretools.vscode-docker
RUN code-server --install-extension felixfbecker.php-intellisense
RUN code-server --install-extension golang.Go
RUN code-server --install-extension vscode-icons-team.vscode-icons
RUN code-server --install-extension formulahendry.auto-rename-tag
RUN code-server --install-extension christian-kohler.path-intellisense
RUN code-server --install-extension	alefragnani.Bookmarks
RUN code-server --install-extension ms-toolsai.jupyter
RUN code-server --install-extension	hediet.vscode-drawio
RUN code-server --install-extension	mtxr.sqltools
RUN code-server --install-extension	msjsdiag.debugger-for-chrome


WORKDIR /home/coder/workspaces
RUN sudo chown coder:coder /home/coder/workspaces	


ADD ./files/script.sh /tmp
RUN sh /tmp/script.sh


WORKDIR /home/coder
